dwc_otg: make nak_holdoff work as intended with empty queues
authorP33M <p33m@github.com>
Thu, 27 Apr 2017 15:24:34 +0000 (16:24 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:53:34 +0000 (15:53 +0100)
commit467ba80f1348595fea2c94e8a5257386e4dc5ef4
tree96f71385e2bfdb1f84dbe960a4a60cab19561812
parent1e466581a64f5b7e42b404aa0a935be01a29aed1
dwc_otg: make nak_holdoff work as intended with empty queues

If URBs reading from non-periodic split endpoints were dequeued and
the last transfer from the endpoint was a NAK handshake, the resulting
qh->nak_frame value was stale which would result in unnecessarily long
polling intervals for the first subsequent transfer with a fresh URB.

Fixup qh->nak_frame in dwc_otg_hcd_urb_dequeue and also guard against
a case where a single URB is submitted to the endpoint, a NAK was
received on the transfer immediately prior to receiving data and the
device subsequently resubmits another URB past the qh->nak_frame interval.

Fixes https://github.com/raspberrypi/linux/issues/1709
drivers/usb/host/dwc_otg/dwc_otg_hcd.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c